import request from '@/utils/request'

// 获取列表
export function getCustomers(data) {
  return request({
    url: '/Customer/',
    method: 'get',
    params: data
  })
}

// 获取
export function getCustomer(id) {
  return request({
    url: `/Customer/${id}/`,
    method: 'get'
  })
}

// 新增
export function createCustomer(data) {
  return request({
    url: '/Customer/',
    method: 'post',
    data
  })
}

// 修改
export function updateCustomer(data) {
  return request({
    url: '/Customer/',
    method: 'put',
    data
  })
}

// 删除
export function deleteCustomer(id) {
  return request({
    url: `/Customer/${id}/`,
    method: 'delete'
  })
}

// 批量删除
export function deleteCustomers(ids) {
  return request({
    url: '/Customer/',
    method: 'delete',
    data: ids
  })
}

// 生成客户编号
export function generateCustomerCode() {
  return request({
    url: '/Customer/Code/',
    method: 'get'
  })
}
